import os
import configparser
from config import DIR_PATH

conf_path = os.path.join(DIR_PATH, 'conf', 'config.ini')

class ConfigUtils:

    def __init__(self):
        self.cfg = configparser.ConfigParser()
        self.cfg.read(conf_path, encoding="utf-8")

    def get_host(self):
        return self.cfg.get("DEFAULT", "url")

    def time_out(self):
        return self.cfg.get("DEFAULT", "time_out")

    def driver_name(self):
        return self.cfg.get("DEFAULT", "DRIVER_NAME")

    def case_path(self):
        return self.cfg.get("PATH", "case_path")

    def report_path(self):
        return self.cfg.get("PATH", "report_path")

    def image_path(self):
        return self.cfg.get("PATH", "image_path")

    def log_path(self):
        return self.cfg.get("PATH", "log_path")

    def data_path(self):
        return self.cfg.get("PATH", "data_path")


local_config = ConfigUtils()